package com.kasinf.sample.mybatis.controller.vo;

import com.kasinf.sample.mybatis.dal.dataobject.UserDO;
import com.kasinf.sample.mybatis.dal.enums.UserStatus;
import lombok.Data;
import org.dromara.core.trans.anno.Trans;
import org.dromara.core.trans.constant.TransType;
import org.dromara.core.trans.vo.VO;

import java.time.LocalDateTime;

/**
 * @Author : Kaiser
 * @Date: 2025/5/19  15:13
 */
@Data
public class UserVO implements VO {

    Long id;

    String username;

    String password;

    String nickname;

    String email;

    String phone;

    @Trans(type = TransType.ENUM, key = "text")
    UserStatus status = UserStatus.NORMAL;

//    @Trans(type = TransType.SIMPLE, target = UserDO.class, fields = "nickname", ref = "creatorName")
    @Trans(type = TransType.AUTO_TRANS, key = "user", targetClassName = "com.kasinf.sample.mybatis.trans.dto.UserDTO",
            fields = "nickname", ref = "creatorName")
    String creator;

    String creatorName;

    LocalDateTime createTime;

    LocalDateTime updateTime;
}
